<!--
 * @Author: yaojian66 1327629137@qq.com
 * @Date: 2022-06-24 14:57:23
 * @LastEditors: yaojian66 1327629137@qq.com
 * @LastEditTime: 2022-06-24 14:59:54
 * @FilePath: \geyao\第四十三题 输出对应得年月日.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>输出对应类型得年月日</title>
</head>
<body>
  
  <script>
    // 请补全JavaScript函数，要求以字符串的形式输出时间戳参数所对应的"年-月-日"。
// 示例：
// 1. _date(1631159776311) -> '2021-9-9'
    function _date(number) {
    // 补全代码
    let date = new Date(number);
  return `${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()}`
}
  </script>
</body>
</html>